<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="typeDetail.title"/></title>
<content tag="heading"><fmt:message key="typeDetail.heading"/></content>

<html:form action="saveType" method="post" styleId="typeForm" onsubmit="return validateTypeForm(this)">
<ul>

<html:hidden property="id"/>

    <li>
        <EnglishRepository:label styleClass="desc" key="typeForm.typeId"/>
        <html:errors property="typeId"/>
        <html:text property="typeId" styleId="typeId" styleClass="text medium"/>

    </li>

    <li>
        <EnglishRepository:label styleClass="desc" key="typeForm.typeName"/>
        <html:errors property="typeName"/>
        <html:text property="typeName" styleId="typeName" styleClass="text medium"/>

    </li>

    <li>
        <EnglishRepository:label styleClass="desc" key="typeForm.description"/>
        <html:errors property="description"/>
        <html:text property="description" styleId="description" styleClass="text medium"/>

    </li>

    <li>
        <EnglishRepository:label styleClass="desc" key="typeForm.categoryId"/>
        <!-- html:text property="categoryId" styleId="categoryId" styleClass="text medium"/-->
            <html:select property="categoryId">
            	<html:options collection="categorys" property="categoryId" labelProperty="categoryName"/>
            </html:select>
    </li>

    <li class="buttonBar bottom">
        <html:submit styleClass="button" property="method.save" onclick="bCancel=false">
            <fmt:message key="button.save"/>
        </html:submit>

        <html:submit styleClass="button" property="method.delete" onclick="bCancel=true; return confirmDelete('Type')">
            <fmt:message key="button.delete"/>
        </html:submit>

        <html:cancel styleClass="button" onclick="bCancel=true">
            <fmt:message key="button.cancel"/>
        </html:cancel>
    </li>
</ul>
</html:form>

<script type="text/javascript">
    Form.focusFirstElement($("typeForm"));
</script>

<html:javascript formName="typeForm" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<html:rewrite page="/scripts/validator.jsp"/>"></script>
